<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="es" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="style.css" rel="stylesheet" type="text/css" />
<title>collision.monkey</title>
</head>
<body>
<h3>collision.monkey</h3><h3>Table of contents:</h3>Classes:<br><ul><li><a href='#72tlCollisionResult'>tlCollisionResult</a> <i>( Class tlCollisionResult  ) </i> <br/><li><a href='#200tlBox'>tlBox</a> <i>( Class tlBox  ) </i> <br/><li><a href='#1262tlCircle'>tlCircle</a> <i>( Class tlCircle Extends tlBox  ) </i> <br/><li><a href='#1814tlPolygon'>tlPolygon</a> <i>( Class tlPolygon Extends tlBox  ) </i> <br/><li><a href='#2561tlLine'>tlLine</a> <i>( Class tlLine Extends tlPolygon  ) </i> <br/></ul>Functions:<br><ul><li><a href='#3105CheckRayCollision'>CheckRayCollision</a> <i>( Function CheckRayCollision:tlCollisionResult(target:tlBox, px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0) ) </i> <br/><li><a href='#3116LineToCircle'>LineToCircle</a> <i>( Function LineToCircle:Int(x1:Float, y1:Float, x2:Float, y2:Float, px:Float, py:Float, r:Float) ) </i> <br/><li><a href='#3141LinesCross'>LinesCross</a> <i>( Function LinesCross:Int(x0:Float, y0:Float, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float) ) </i> <br/><li><a href='#3166LinesCrossAtPoint'>LinesCrossAtPoint</a> <i>( Function LinesCrossAtPoint:Int(x0:Float, y0:Float, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float, points:Float[]) ) </i> <br/><li><a href='#3194GetQuad'>GetQuad</a> <i>( Function GetQuad:Int(axis_x:Float, axis_y:Float, vert_x:Float, vert_y:Float) ) </i> <br/><li><a href='#3214WithinFieldOfView'>WithinFieldOfView</a> <i>( Function WithinFieldOfView:Int(Observer_x:Float, Observer_y:Float, FOV:Float, Direction:Float, PointX:Float, PointY:Float) ) </i> <br/><li><a href='#3223NearestPointToCircle'>NearestPointToCircle</a> <i>( Function NearestPointToCircle:Int(x1:Float, y1:Float, x2:Float, y2:Float, px:Float, py:Float, r:Float, points:Float[]) ) </i> <br/><li><a href='#3242IntervalDistance'>IntervalDistance</a> <i>( Function IntervalDistance:Float(min0:Float, max0:Float, min1:Float, max1:Float) ) </i> <br/><li><a href='#3257CreateBox'>CreateBox</a> <i>( Function CreateBox:tlBox(x:Float, y:Float, w:Float, h:Float, layer:Int = tlLAYER_0) ) </i> <br/><li><a href='#3270CreateLine'>CreateLine</a> <i>( Function CreateLine:tlLine(x1:Float, y1:Float, x2:Float, y2:Float, layer:Int = tlLAYER_0) ) </i> <br/><li><a href='#3281CreateCircle'>CreateCircle</a> <i>( Function CreateCircle:tlCircle(x:Float, y:Float, radius:Float, layer:Int = tlLAYER_0) ) </i> <br/><li><a href='#3294CreatePolygon'>CreatePolygon</a> <i>( Function CreatePolygon:tlPolygon(x:Float, y:Float, verts:Float[], layer:Int = tlLAYER_0) ) </i> <br/></ul><table style='width: 100%'><tr id=3105CheckRayCollision><td class='tablehead' colspan='2' id=CheckRayCollision>Function CheckRayCollision:tlCollisionResult(target:tlBox, px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0)</td></tr><tr><td style='width:90px'>Description:</td><td>See if a ray collides with a boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns #tlCollisionResult with the results of the collision<br />	You can use this to test for a collision with a ray and any type of boundary: #tlBox, #tlCircle, #tlLine and #tlPolygon. <br />	Pass the origin of the ray with px and py, and set the direction of the raycast with dx and dy vector. dx and dy will be normalised and extended <br />	infinitely if maxdistance equals 0 (default), otherwise set maxdistance to how ever far you want the ray to extend to before stopping. If the ray starts <br />	inside the poly then result.rayorigininside will be set to true. You can find the angle of reflection to bounce the ray using #GetReboundVector. <br /></td></tr></table><table style='width: 100%'><tr id=3257CreateBox><td class='tablehead' colspan='2' id=CreateBox>Function CreateBox:tlBox(x:Float, y:Float, w:Float, h:Float, layer:Int = tlLAYER_0)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a new tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlBox</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns New tlBox<br />	Creates a new Bounding box that you can use for collision checking and adding to a #tlQuadTree. Use layer to specify a particular layer<br />	to place the box on so that you can more easily organise your collisions. You use tlLAYER_0, tlLAYER_1..and so on up to tlLAYER_31.<br />	to place the boundary on all layers.<br /></td></tr></table><table style='width: 100%'><tr id=3281CreateCircle><td class='tablehead' colspan='2' id=CreateCircle>Function CreateCircle:tlCircle(x:Float, y:Float, radius:Float, layer:Int = tlLAYER_0)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCircle</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns New #tlLine<br />	Create a new #tlLine at the given coordinates with the given radius. The coordinates will represent the center of the circle. Use layer to specify a particular layer<br />	to place the box on so that you can more easily organise your collisions. You use tlLAYER_0, tlLAYER_1..and so on up to tlLAYER_31.<br />	to place the boundary on all layers.<br /></td></tr></table><table style='width: 100%'><tr id=3270CreateLine><td class='tablehead' colspan='2' id=CreateLine>Function CreateLine:tlLine(x1:Float, y1:Float, x2:Float, y2:Float, layer:Int = tlLAYER_0)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlLine</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns New tlCircle<br />	Create a new #tlLine at the coordinates given, x1 and y1 being the start of the line and x2 and y2 being the end. The will placed exactly<br />	according to the coordinates you give, but it's worth bearing in mind that the handle of the line will be at the center point along the line. Therefore<br />	the world coordinates will be set to half way point along the line. Use layer to specify a particular layer<br />	to place the box on so that you can more easily organise your collisions. You use tlLAYER_0, tlLAYER_1..and so on up to tlLAYER_31.<br />	to place the boundary on all layers.<br /></td></tr></table><table style='width: 100%'><tr id=3294CreatePolygon><td class='tablehead' colspan='2' id=CreatePolygon>Function CreatePolygon:tlPolygon(x:Float, y:Float, verts:Float[], layer:Int = tlLAYER_0)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlPolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>tlPolygon</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns New #tlPolygon, or Null if verts[] contained the wrong amount.<br />	Create a new #tlPolygon at the given coordinates with the given array of vertices. The coordinates will represent the center of the polygon which is<br />	automatically calculated. The array must contain more then 5 values (2 per vertex) and be an even number or null will be returned. The coordinates of<br />	the vertices in the array are arranged like so: [x,y,x,y,x,y .. etc]. Use layer to specify a particular layer<br />	to place the box on so that you can more easily organise your collisions. You use tlLAYER_0, tlLAYER_1..and so on up to tlLAYER_31<br />	to place the boundary on all layers.<br /></td></tr></table><table style='width: 100%'><tr id=3194GetQuad><td class='tablehead' colspan='2' id=GetQuad>Function GetQuad:Int(axis_x:Float, axis_y:Float, vert_x:Float, vert_y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Get the quad a vertex lies within</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	This will return the quad a vertex lies within according to the x and y axis you pass it.<br /></td></tr></table><table style='width: 100%'><tr id=3242IntervalDistance><td class='tablehead' colspan='2' id=IntervalDistance>Function IntervalDistance:Float(min0:Float, max0:Float, min1:Float, max1:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Find the amount of overlap between 2 1D lines</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns The amount of overlap. Any value less then 0 is not overlapping.<br /></td></tr></table><table style='width: 100%'><tr id=3116LineToCircle><td class='tablehead' colspan='2' id=LineToCircle>Function LineToCircle:Int(x1:Float, y1:Float, x2:Float, y2:Float, px:Float, py:Float, r:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Do a Line to Circle collision check</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns True if line and circle overlap<br />	x1, y1 and x2, y2 represent the beginning and end line coordinates, and px, py and r represent the circle coordinates and radius. <br /></td></tr></table><table style='width: 100%'><tr id=3141LinesCross><td class='tablehead' colspan='2' id=LinesCross>Function LinesCross:Int(x0:Float, y0:Float, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Do a Line to Line collision check</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns True if lines overlap<br />	x0, y0, x1, y1 is the first line and x2, y2, x3, y3 is the second line you want want check for an intersection<br /></td></tr></table><table style='width: 100%'><tr id=3166LinesCrossAtPoint><td class='tablehead' colspan='2' id=LinesCrossAtPoint>Function LinesCrossAtPoint:Int(x0:Float, y0:Float, x1:Float, y1:Float, x2:Float, y2:Float, x3:Float, y3:Float, points:Float[])</td></tr><tr><td style='width:90px'>Description:</td><td>Do a Line to Line collision check and return the point of intersection.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns True if lines overlap, and Sets X_Point and Y_Point to the point of interection.<br />	x0, y0, x1, y1 is the first line and x2, y2, x3, y3 is the second line you want want check for an intersection<br /></td></tr></table><table style='width: 100%'><tr id=3223NearestPointToCircle><td class='tablehead' colspan='2' id=NearestPointToCircle>Function NearestPointToCircle:Int(x1:Float, y1:Float, x2:Float, y2:Float, px:Float, py:Float, r:Float, points:Float[])</td></tr><tr><td style='width:90px'>Description:</td><td>Return the nearest point on a line to the center of a circle</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns NearestPoint_x and NearestPoint_y<br />	x1, y1 and x2, y2 represent the beginning and end line coordinates, and px, py and r represent the circle coordinates and radius. <br /></td></tr></table><table style='width: 100%'><tr id=3214WithinFieldOfView><td class='tablehead' colspan='2' id=WithinFieldOfView>Function WithinFieldOfView:Int(Observer_x:Float, Observer_y:Float, FOV:Float, Direction:Float, PointX:Float, PointY:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Check if a point is with a field of view</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>	Returns True if if point is withing observers fov, otherwise false<br /></td></tr></table><table style='width: 100%' id=200tlBox><tr id=tlBox><td class='tablehead' colspan='2'>Class tlBox </td></tr><tr><td style='width:90px'>Description:</td><td>Collision box class</td></tr><tr><td style='width:90px'>Table of contents:</td><td>Methods:<br><ul><li><a href='#465BoundingBoxOverlap'>BoundingBoxOverlap</a> <i>( Method BoundingBoxOverlap:Int(rect:tlBox, velocitycheck:Int = False) ) </i> <br/><li><a href='#504BoxCollide'>BoxCollide</a> <i>( Method BoxCollide:tlCollisionResult(box:tlBox) ) </i> <br/><li><a href='#620CircleCollide'>CircleCollide</a> <i>( Method CircleCollide:tlCollisionResult(circle:tlCircle) ) </i> <br/><li><a href='#489CircleOverlap'>CircleOverlap</a> <i>( Method CircleOverlap:Int(circle:tlCircle) ) </i> <br/><li><a href='#334CollisionLayer'>CollisionLayer</a> <i>( Method CollisionLayer:Int() Property ) </i> <br/><li><a href='#345CollisionLayer'>CollisionLayer</a> <i>( Method CollisionLayer(Layer:Int) Property ) </i> <br/><li><a href='#317Data'>Data</a> <i>( Method Data(d:Object) Property ) </i> <br/><li><a href='#325Data'>Data</a> <i>( Method Data:Object() Property ) </i> <br/><li><a href='#949Draw'>Draw</a> <i>( Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False) ) </i> <br/><li><a href='#972GetCollisionType'>GetCollisionType</a> <i>( Method GetCollisionType:Int() ) </i> <br/><li><a href='#1077GetShadowPolys'>GetShadowPolys</a> <i>( Method GetShadowPolys:TList (Light:tlVector2, lType:Int = tlDIRECTIONAL_LIGHT, lengthfactor:Float = 1) ) </i> <br/><li><a href='#402GetWorldX'>GetWorldX</a> <i>( Method GetWorldX:Float() ) </i> <br/><li><a href='#412GetWorldY'>GetWorldY</a> <i>( Method GetWorldY:Float() ) </i> <br/><li><a href='#428Height'>Height</a> <i>( Method Height:Float() Property ) </i> <br/><li><a href='#710LineCollide'>LineCollide</a> <i>( Method LineCollide:tlCollisionResult(line:tlLine) ) </i> <br/><li><a href='#367Move'>Move</a> <i>( Method Move(x:Float, y:Float) ) </i> <br/><li><a href='#455PointInside'>PointInside</a> <i>( Method PointInside:Int(x:Float, y:Float) ) </i> <br/><li><a href='#799PolyCollide'>PolyCollide</a> <i>( Method PolyCollide:tlCollisionResult(poly:tlPolygon) ) </i> <br/><li><a href='#981PreventOverlap'>PreventOverlap</a> <i>( Method PreventOverlap(result:tlCollisionResult, push:Int = False) ) </i> <br/><li><a href='#887RayCollide'>RayCollide</a> <i>( Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0) ) </i> <br/><li><a href='#289ReDimension'>ReDimension</a> <i>( Method ReDimension(x:Float, y:Float, w:Float, h:Float) ) </i> <br/><li><a href='#480RectWithin'>RectWithin</a> <i>( Method RectWithin:Int(rect:tlBox) ) </i> <br/><li><a href='#1021Repel'>Repel</a> <i>( Method Repel(result:tlCollisionResult, push:Int = False, factor:Float = 0.1) ) </i> <br/><li><a href='#1060Separate'>Separate</a> <i>( Method Separate(result:tlCollisionResult, sourcefactor:Float = 0.1, targetfactor:Float = 0.1) ) </i> <br/><li><a href='#378SetHandlePosition'>SetHandlePosition</a> <i>( Method SetHandlePosition(x:Float, y:Float) ) </i> <br/><li><a href='#354SetPosition'>SetPosition</a> <i>( Method SetPosition(x:Float, y:Float) ) </i> <br/><li><a href='#445SetScale'>SetScale</a> <i>( Method SetScale(x:Float, y:Float) ) </i> <br/><li><a href='#437SetVelocity'>SetVelocity</a> <i>( Method SetVelocity(velocity_x:Float, velocity_y:Float) ) </i> <br/><li><a href='#392UpdatePosition'>UpdatePosition</a> <i>( Method UpdatePosition() ) </i> <br/><li><a href='#420Width'>Width</a> <i>( Method Width:Float() Property ) </i> <br/></ul></td></tr><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=465BoundingBoxOverlap><td class='subtablehead' colspan='2' id=BoundingBoxOverlap>Method BoundingBoxOverlap:Int(rect:tlBox, velocitycheck:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Compare this #tlBox with another to see if they overlap</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if they do overlap<br />		Use this to find out if this #tlBox overlaps the #tlBox you pass to it. This is a very simple overlap to see if the bounding box overlaps only<br />		Set VelocityCheck to true if you want to see if they will overlap next frame based on their velocities.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=504BoxCollide><td class='subtablehead' colspan='2' id=BoxCollide>Method BoxCollide:tlCollisionResult(box:tlBox)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with another #tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with another #tlBox that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=620CircleCollide><td class='subtablehead' colspan='2' id=CircleCollide>Method CircleCollide:tlCollisionResult(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlCircle that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=489CircleOverlap><td class='subtablehead' colspan='2' id=CircleOverlap>Method CircleOverlap:Int(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Compare this #tlBox with a #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if they do overlap<br />		This will perfrom a simple bounding box to circle collision check on the #tlCircle you pass to it. <br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=334CollisionLayer><td class='subtablehead' colspan='2' id=CollisionLayer>Method CollisionLayer:Int() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the collision layer that this boundary is on</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns The Collision layer flag<br />		Every boundary can exist on a sepcific layer from 1-32 to make it easier to handle what objects you want to collide with each other.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=345CollisionLayer><td class='subtablehead' colspan='2' id=CollisionLayer>Method CollisionLayer(Layer:Int) Property</td></tr><tr><td style='width:90px'>Description:</td><td>Set the collision layer that this boundary is on</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		The layer a boundary is on can determine what other boundarys this one can collide with. You may not want some objects to be able to collide<br />		with each other, so you can arrange them of different layers. There are 32 layers, assigned to constants: tlLAYER_0, tlLAYER1, tlLAYER_2 and so on up<br />		to 32, so to assign a layer, simply pass the appropriate constant:<br />		<pre>MyBox.SetCollisionLayer(tlLAYER_1)</pre><br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=317Data><td class='subtablehead' colspan='2' id=Data>Method Data(d:Object) Property</td></tr><tr><td style='width:90px'>Description:</td><td>Assign an object to the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This can be handy to store extra custom info about the boundary. <br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=325Data><td class='subtablehead' colspan='2' id=Data>Method Data:Object() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the data assigned to this boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Object</td></tr><tr><td style='width:90px'>Details:</td><td>		Use this to retrieve the custom data you have assign to the boundary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=949Draw><td class='subtablehead' colspan='2' id=Draw>Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Draw this tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Use this if you need to draw the bounding box for debugging purposes<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=972GetCollisionType><td class='subtablehead' colspan='2' id=GetCollisionType>Method GetCollisionType:Int()</td></tr><tr><td style='width:90px'>Description:</td><td>Get the collision type of the Box</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns Either tlBOX_COLLISION, tlCIRCLE_COLLISION, tlLINE_COLLISION or tlPOLY_COLLISION<br />		the collision type can help you determine what type of collision you should be performing on objects calledback from quadtree queries.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1077GetShadowPolys><td class='subtablehead' colspan='2' id=GetShadowPolys>Method GetShadowPolys:TList (Light:tlVector2, lType:Int = tlDIRECTIONAL_LIGHT, lengthfactor:Float = 1)</td></tr><tr><td style='width:90px'>Description:</td><td>Get a poly represting the shadow of the box</td></tr><tr><td style='width:90px'>Returns:</td><td>TList</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns tList of tlPolygons representing each shadow cast by each line in the box<br />		This will take a light located at Light:tlVector2 and create a list of tlPolygons representing a shadow cast by each line in the box.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=402GetWorldX><td class='subtablehead' colspan='2' id=GetWorldX>Method GetWorldX:Float()</td></tr><tr><td style='width:90px'>Description:</td><td>Get the x world coordinate of the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns Float with the current x coordinate<br />		You can use this to find out the current x coordinate of the boundary. This would be especially useful if you have just used #PreventOverlap<br />		and need to know the new position of the object to update your game object.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=412GetWorldY><td class='subtablehead' colspan='2' id=GetWorldY>Method GetWorldY:Float()</td></tr><tr><td style='width:90px'>Description:</td><td>Get the y world coordinate of the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns Float with the current y coordinate<br />		You can use this to find out the current y coordinate of the boundary. This would be especially useful if you have just used #PreventOverlap<br />		and need to know the new position of the object to update your game object.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=428Height><td class='subtablehead' colspan='2' id=Height>Method Height:Float() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the current height of the box</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns The current height taking into account scale<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=710LineCollide><td class='subtablehead' colspan='2' id=LineCollide>Method LineCollide:tlCollisionResult(line:tlLine)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlLine that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=367Move><td class='subtablehead' colspan='2' id=Move>Method Move(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Move the bounding box by a given amount.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets the position of the top left corner of the bounding box by moving it by the x and y amount. If the box is within quadtree it <br />		will automatically update itself within it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=455PointInside><td class='subtablehead' colspan='2' id=PointInside>Method PointInside:Int(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if a point is within the bounding box</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if the point is within<br />		Use this to find out if a point at x,y falls with the bounding box of this #tlBox<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=799PolyCollide><td class='subtablehead' colspan='2' id=PolyCollide>Method PolyCollide:tlCollisionResult(poly:tlPolygon)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlPolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlPolygon that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=981PreventOverlap><td class='subtablehead' colspan='2' id=PreventOverlap>Method PreventOverlap(result:tlCollisionResult, push:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Prevent the boundary from overlapping another based on the result of a collision.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		When you check for a collision, the results of that collision are stored with a #tlCollisionResult. This can be passed to this method<br />		to prevent 2 boundaries from overlapping. If push is set to true, then the source boundary will push the target boundary along it's velocity vector.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=887RayCollide><td class='subtablehead' colspan='2' id=RayCollide>Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0)</td></tr><tr><td style='width:90px'>Description:</td><td>See is a ray collides with this #tlbox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult with the results of the collision<br />		You can use this to test for a collision with a ray. Pass the origin of the ray with px and py, and set the direction of the ray with dx and dy.<br />		dx and dy will be normalised and extended infinitely, if maxdistance equals 0 (default), otherwise set maxdistance to how ever far you want the ray <br />		to extend to. If the ray starts inside the box then result.rayorigininside will be set to true.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=289ReDimension><td class='subtablehead' colspan='2' id=ReDimension>Method ReDimension(x:Float, y:Float, w:Float, h:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Reset the dimensions of the box to a new width and height</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=480RectWithin><td class='subtablehead' colspan='2' id=RectWithin>Method RectWithin:Int(rect:tlBox)</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if a #tlBox lies within this objects bounding box</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if it is within<br />		If you need to know whether a #tlBox you pass to this method, lies entirely with this #tlBox (no overlapping) then you can use this method. <br />		#REMember, if you call this method from a poly, line or circle, it will only check against the bounding boxes.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1021Repel><td class='subtablehead' colspan='2' id=Repel>Method Repel(result:tlCollisionResult, push:Int = False, factor:Float = 0.1)</td></tr><tr><td style='width:90px'>Description:</td><td>Repel boundaries that overlap</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Rather then simply preventing an overlap outright, this will ease a boundary away slowly until it no longer overlaps. This can <br />		be useful to separate groups of entities away from each other in a more smooth fashion. As with #PreventOverlap set push to true to push<br />		the other entity away.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1060Separate><td class='subtablehead' colspan='2' id=Separate>Method Separate(result:tlCollisionResult, sourcefactor:Float = 0.1, targetfactor:Float = 0.1)</td></tr><tr><td style='width:90px'>Description:</td><td>Separate boundaries that overlap</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This is slightly different to #Repel in that both objects will be moved away from each other according to the 2 factors<br />		you pass to it. So you can either push them away from each other equally or you can weight one or the other.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=378SetHandlePosition><td class='subtablehead' colspan='2' id=SetHandlePosition>Method SetHandlePosition(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the handle of the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		setting the handle let's you offset where the boundary exists in the world. By default the handle is located at the center of the boudary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=354SetPosition><td class='subtablehead' colspan='2' id=SetPosition>Method SetPosition(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the position of the bounding box.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets the position of the top left corner of the bounding box. If the box is within quadtree it will automatically update itself<br />		within it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=445SetScale><td class='subtablehead' colspan='2' id=SetScale>Method SetScale(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the scale of the Box</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets scale of the Box.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=437SetVelocity><td class='subtablehead' colspan='2' id=SetVelocity>Method SetVelocity(velocity_x:Float, velocity_y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the velocity of the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		It's import to set the velocity of the boundary so that collisions can be more accurately calculated. If you're attaching this<br />		to an entity in your game then you'll just need to match this to your entities velocity.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=392UpdatePosition><td class='subtablehead' colspan='2' id=UpdatePosition>Method UpdatePosition()</td></tr><tr><td style='width:90px'>Description:</td><td>Update the position of the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		You can use this method to update it's position according to its current velocity vector<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=420Width><td class='subtablehead' colspan='2' id=Width>Method Width:Float() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the current width of the box</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns The current width taking into account scale<br /></td></tr></table></tr></td></table><br /><table style='width: 100%' id=1262tlCircle><tr id=tlCircle><td class='tablehead' colspan='2'>Class tlCircle Extends tlBox </td></tr><tr><td style='width:90px'>Description:</td><td>Collision circle class</td></tr><tr><td style='width:90px'>Table of contents:</td><td>Methods:<br><ul><li><a href='#1318BoundingBoxOverlap'>BoundingBoxOverlap</a> <i>( Method BoundingBoxOverlap:Int(rect:tlBox, velocitycheck:Int = False) ) </i> <br/><li><a href='#1333BoxCollide'>BoxCollide</a> <i>( Method BoxCollide:tlCollisionResult(box:tlBox) ) </i> <br/><li><a href='#1424CircleCollide'>CircleCollide</a> <i>( Method CircleCollide:tlCollisionResult(circle:tlCircle) ) </i> <br/><li><a href='#1309CircleOverlap'>CircleOverlap</a> <i>( Method CircleOverlap:Int(circle:tlCircle) ) </i> <br/><li><a href='#1783Draw'>Draw</a> <i>( Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False) ) </i> <br/><li><a href='#1507LineCollide'>LineCollide</a> <i>( Method LineCollide:tlCollisionResult(line:tlLine) ) </i> <br/><li><a href='#1273New'>New</a> <i>( Method New(x:Float, y:Float, radius:Float, layer:Int = tlLAYER_0, data:Object = Null) ) </i> <br/><li><a href='#1300PointInside'>PointInside</a> <i>( Method PointInside:Int(x:Float, y:Float) ) </i> <br/><li><a href='#1601PolyCollide'>PolyCollide</a> <i>( Method PolyCollide:tlCollisionResult(poly:tlPolygon) ) </i> <br/><li><a href='#1291Radius'>Radius</a> <i>( Method Radius:Float() Property ) </i> <br/><li><a href='#1696RayCollide'>RayCollide</a> <i>( Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0) ) </i> <br/><li><a href='#1768SetCircle'>SetCircle</a> <i>( Method SetCircle(x:Float, y:Float, _radius:Float) ) </i> <br/></ul></td></tr><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1318BoundingBoxOverlap><td class='subtablehead' colspan='2' id=BoundingBoxOverlap>Method BoundingBoxOverlap:Int(rect:tlBox, velocitycheck:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Compare this #tlCircle with a #tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if they do overlap<br />		This will perfrom a simple circle to bounding box overlap check on the #tlBox you pass to it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1333BoxCollide><td class='subtablehead' colspan='2' id=BoxCollide>Method BoxCollide:tlCollisionResult(box:tlBox)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlBox that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1424CircleCollide><td class='subtablehead' colspan='2' id=CircleCollide>Method CircleCollide:tlCollisionResult(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with another #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with another #tlCircle that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1309CircleOverlap><td class='subtablehead' colspan='2' id=CircleOverlap>Method CircleOverlap:Int(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Compare this circle with another #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if they do overlap<br />		This will perfrom a simple circle to circle collision check on the #tlCircle you pass to it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1783Draw><td class='subtablehead' colspan='2' id=Draw>Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Draw this tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Use this if you need to draw the bounding box for debugging purposes. Pass true of false to draw the bounding box as well.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1507LineCollide><td class='subtablehead' colspan='2' id=LineCollide>Method LineCollide:tlCollisionResult(line:tlLine)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlLine that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1273New><td class='subtablehead' colspan='2' id=New>Method New(x:Float, y:Float, radius:Float, layer:Int = tlLAYER_0, data:Object = Null)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlCircle</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns New #tlCircle<br />		Create a new #tlCircle at the given coordinates with the given radius. The coordinates will represent where the center of the circle is located<br />		in the world. You can also assign some data to the boundary as handy way to store some extra info about the boundary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1300PointInside><td class='subtablehead' colspan='2' id=PointInside>Method PointInside:Int(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if a point is within the circle</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if the point is within<br />		Use this to find out if a point at x,y falls with the radius of this #tlCircle<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1601PolyCollide><td class='subtablehead' colspan='2' id=PolyCollide>Method PolyCollide:tlCollisionResult(poly:tlPolygon)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlPolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with another #tlPolygon that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1291Radius><td class='subtablehead' colspan='2' id=Radius>Method Radius:Float() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the current radius of the box</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns The current radius taking into account scale<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1696RayCollide><td class='subtablehead' colspan='2' id=RayCollide>Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0)</td></tr><tr><td style='width:90px'>Description:</td><td>See is a ray collides with this #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult with the results of the collision<br />		You can use this to test for a collision with a ray. Pass the origin of the ray with px and py, and set the direction of the ray with dx and dy.<br />		dx and dy will be normalised and extended infinitely, if maxdistance equals 0 (default), otherwise set maxdistance to how ever far you want the ray <br />		to extend to. If the ray starts inside the poly then result.rayorigininside will be set to true.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1768SetCircle><td class='subtablehead' colspan='2' id=SetCircle>Method SetCircle(x:Float, y:Float, _radius:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the Box of the circle</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		this lets you change the size and location of the #tlCircle<br /></td></tr></table></tr></td></table><br /><table style='width: 100%' id=72tlCollisionResult><tr id=tlCollisionResult><td class='tablehead' colspan='2'>Class tlCollisionResult </td></tr><tr><td style='width:90px'>Description:</td><td>Class for storing the results of a collision</td></tr><tr><td style='width:90px'>Table of contents:</td><td>Methods:<br><ul><li><a href='#174GetReboundVector'>GetReboundVector</a> <i>( Method GetReboundVector:tlVector2(v:tlVector2, friction:Float = 0, bounce:Float = 1) ) </i> <br/><li><a href='#91Intersecting'>Intersecting</a> <i>( Method Intersecting:Int() Property ) </i> <br/><li><a href='#99IsColliding'>IsColliding</a> <i>( Method IsColliding:Int() Property ) </i> <br/><li><a href='#118RayDistance'>RayDistance</a> <i>( Method RayDistance:Float() Property ) </i> <br/><li><a href='#138RayIntersection'>RayIntersection</a> <i>( Method RayIntersection:tlVector2() Property ) </i> <br/><li><a href='#192RayOriginInside'>RayOriginInside</a> <i>( Method RayOriginInside:Int() Property ) </i> <br/><li><a href='#147RaySurfaceNormal'>RaySurfaceNormal</a> <i>( Method RaySurfaceNormal:tlVector2() Property ) </i> <br/><li><a href='#155SourceBoundary'>SourceBoundary</a> <i>( Method SourceBoundary:tlBox() Property ) </i> <br/><li><a href='#163TargetBoundary'>TargetBoundary</a> <i>( Method TargetBoundary:tlBox() Property ) </i> <br/><li><a href='#129TranslationVector'>TranslationVector</a> <i>( Method TranslationVector:tlVector2() Property ) </i> <br/><li><a href='#110WillIntersect'>WillIntersect</a> <i>( Method WillIntersect:Int() Property ) </i> <br/></ul></td></tr><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=174GetReboundVector><td class='subtablehead' colspan='2' id=GetReboundVector>Method GetReboundVector:tlVector2(v:tlVector2, friction:Float = 0, bounce:Float = 1)</td></tr><tr><td style='width:90px'>Description:</td><td>Get the rebound vector</td></tr><tr><td style='width:90px'>Returns:</td><td>tlVector2</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns New #tlVector2 with the resulting rebound vector<br />		When an object collides with a surface you may want to know a resulting vector based on bounce and friction. So you can call this<br />		and pass the velocity vector of the incoming object, and the amount of bounce and friction to have, where a bounce value of 1 and a friction value of 0<br />		will result in a perfect bounce.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=91Intersecting><td class='subtablehead' colspan='2' id=Intersecting>Method Intersecting:Int() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if the last collision check is intersecting</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns true if there was an intersection<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=99IsColliding><td class='subtablehead' colspan='2' id=IsColliding>Method IsColliding:Int() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if the last collision check found a collision</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns true if there was a collision<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=118RayDistance><td class='subtablehead' colspan='2' id=RayDistance>Method RayDistance:Float() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the distance from the ray origin to the instersection point</td></tr><tr><td style='width:90px'>Returns:</td><td>Float</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns float value of distance the ray travelled, 0 if there was no intersection<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=138RayIntersection><td class='subtablehead' colspan='2' id=RayIntersection>Method RayIntersection:tlVector2() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the intersection point of the raycast</td></tr><tr><td style='width:90px'>Returns:</td><td>tlVector2</td></tr><tr><td style='width:90px'>Details:</td><td>		<br />		If a ray cast has been performed and the ray successfully connected, then this will return the point of intersection as a #tlVector2.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=192RayOriginInside><td class='subtablehead' colspan='2' id=RayOriginInside>Method RayOriginInside:Int() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if the last ray cast found that the ray originated inside the boundary</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns true if the last ray check originated inside the boundary<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=147RaySurfaceNormal><td class='subtablehead' colspan='2' id=RaySurfaceNormal>Method RaySurfaceNormal:tlVector2() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the surface normal that the ray hits</td></tr><tr><td style='width:90px'>Returns:</td><td>tlVector2</td></tr><tr><td style='width:90px'>Details:</td><td>		<br />		If a ray cast has been performed and the ray successfully connected, then this will return the normal vector of the surface being hit.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=155SourceBoundary><td class='subtablehead' colspan='2' id=SourceBoundary>Method SourceBoundary:tlBox() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Gets the Source boundary of a collision check</td></tr><tr><td style='width:90px'>Returns:</td><td>tlBox</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlBox Or null if no collision occurred<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=163TargetBoundary><td class='subtablehead' colspan='2' id=TargetBoundary>Method TargetBoundary:tlBox() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Gets the Target boundary of a collision check</td></tr><tr><td style='width:90px'>Returns:</td><td>tlBox</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlBox Or null if no collision occurred<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=129TranslationVector><td class='subtablehead' colspan='2' id=TranslationVector>Method TranslationVector:tlVector2() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Get the translation vector of the collision</td></tr><tr><td style='width:90px'>Returns:</td><td>tlVector2</td></tr><tr><td style='width:90px'>Details:</td><td>		<br />		If the collision check finds that either the objects are intersecting, or they will intersect, then the translation vector hold exactly<br />		how much they do or will overlap. This can then be used to move the 2 objects apart to prevent them overlapping. Handy if you have a wall that you don't<br />		want a player to move through. See #PreventOverlap to automate this process further.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=110WillIntersect><td class='subtablehead' colspan='2' id=WillIntersect>Method WillIntersect:Int() Property</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if the last collision check is intersecting</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns true if there will be an intersection<br />		knowing if there will be an intersection allows you to adjust the position of objects so that visually they will never overlap. To do this<br />		you can use the information stored in the translation vector, which is the vector describing how much the objects need to move so that they no longer<br />		overlap. See #GetTranslationVector<br /></td></tr></table></tr></td></table><br /><table style='width: 100%' id=2561tlLine><tr id=tlLine><td class='tablehead' colspan='2'>Class tlLine Extends tlPolygon </td></tr><tr><td style='width:90px'>Description:</td><td>Collision line class</td></tr><tr><td style='width:90px'>Table of contents:</td><td>Methods:<br><ul><li><a href='#2603BoxCollide'>BoxCollide</a> <i>( Method BoxCollide:tlCollisionResult(Box:tlBox) ) </i> <br/><li><a href='#2691CircleCollide'>CircleCollide</a> <i>( Method CircleCollide:tlCollisionResult(circle:tlCircle) ) </i> <br/><li><a href='#2785LineCollide'>LineCollide</a> <i>( Method LineCollide:tlCollisionResult(line:tlLine) ) </i> <br/><li><a href='#2570New'>New</a> <i>( Method New(x1:Float, y1:Float, x2:Float, y2:Float, layer:Int = tlLAYER_0, data:Object = Null) ) </i> <br/><li><a href='#2875PolyCollide'>PolyCollide</a> <i>( Method PolyCollide:tlCollisionResult(poly:tlPolygon) ) </i> <br/><li><a href='#2966RayCollide'>RayCollide</a> <i>( Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0) ) </i> <br/></ul></td></tr><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2603BoxCollide><td class='subtablehead' colspan='2' id=BoxCollide>Method BoxCollide:tlCollisionResult(Box:tlBox)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlBox that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2691CircleCollide><td class='subtablehead' colspan='2' id=CircleCollide>Method CircleCollide:tlCollisionResult(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlCircle that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2785LineCollide><td class='subtablehead' colspan='2' id=LineCollide>Method LineCollide:tlCollisionResult(line:tlLine)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with another #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with another #tlLine that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2570New><td class='subtablehead' colspan='2' id=New>Method New(x1:Float, y1:Float, x2:Float, y2:Float, layer:Int = tlLAYER_0, data:Object = Null)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlLine</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns New #tlLine<br />		Create a new #tlLine at the coordinates given, x1 and y1 being the start of the line and x2 and y2 being the end. The will placed exactly<br />		according to the coordinates you give, but it's worth bearing in mind that the handle of the line will be at the center point along the line. Therefore<br />		the world coordinates will be set to half way point along the line. You can also assign some data to the boundary as handy way to store some extra info about the boundary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2875PolyCollide><td class='subtablehead' colspan='2' id=PolyCollide>Method PolyCollide:tlCollisionResult(poly:tlPolygon)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlPoly</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlPoly that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2966RayCollide><td class='subtablehead' colspan='2' id=RayCollide>Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0)</td></tr><tr><td style='width:90px'>Description:</td><td>See is a ray collides with this #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult with the results of the collision<br />		You can use this to test for a collision with a ray. Pass the origin of the ray with px and py, and set the direction of the ray with dx and dy.<br />		dx and dy will be normalised and extended infinitely, if maxdistance equals 0 (default), otherwise set maxdistance to how ever far you want the ray <br />		to extend to. If the ray starts inside the poly then result.rayorigininside will be set to true.<br /></td></tr></table></tr></td></table><br /><table style='width: 100%' id=1814tlPolygon><tr id=tlPolygon><td class='tablehead' colspan='2'>Class tlPolygon Extends tlBox </td></tr><tr><td style='width:90px'>Description:</td><td>Collision polygon class</td></tr><tr><td style='width:90px'>Table of contents:</td><td>Methods:<br><ul><li><a href='#2005BoxCollide'>BoxCollide</a> <i>( Method BoxCollide:tlCollisionResult(Box:tlBox) ) </i> <br/><li><a href='#2092CircleCollide'>CircleCollide</a> <i>( Method CircleCollide:tlCollisionResult(circle:tlCircle) ) </i> <br/><li><a href='#2429Draw'>Draw</a> <i>( Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False) ) </i> <br/><li><a href='#2186LineCollide'>LineCollide</a> <i>( Method LineCollide:tlCollisionResult(Line:tlLine) ) </i> <br/><li><a href='#1936Move'>Move</a> <i>( Method Move(x:Float, y:Float) ) </i> <br/><li><a href='#1825New'>New</a> <i>( Method New(x:Float, y:Float, verts:Float[], layer:Int = tlLAYER_0, data:Object = Null, centerhandle:Int = True) ) </i> <br/><li><a href='#1864New'>New</a> <i>( Method New(verts:Float[], layer:Int = tlLAYER_0, data:Object = Null) ) </i> <br/><li><a href='#1965PointInside'>PointInside</a> <i>( Method PointInside:Int(x:Float, y:Float) ) </i> <br/><li><a href='#2276PolyCollide'>PolyCollide</a> <i>( Method PolyCollide:tlCollisionResult(poly:tlPolygon) ) </i> <br/><li><a href='#2367RayCollide'>RayCollide</a> <i>( Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0) ) </i> <br/><li><a href='#1897Rotate'>Rotate</a> <i>( Method Rotate(angle:Float) ) </i> <br/><li><a href='#1907SetAngle'>SetAngle</a> <i>( Method SetAngle(angle:Float) ) </i> <br/><li><a href='#1919SetPosition'>SetPosition</a> <i>( Method SetPosition(x:Float, y:Float) ) </i> <br/><li><a href='#1952SetScale'>SetScale</a> <i>( Method SetScale(x:Float, y:Float) ) </i> <br/></ul></td></tr><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2005BoxCollide><td class='subtablehead' colspan='2' id=BoxCollide>Method BoxCollide:tlCollisionResult(Box:tlBox)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlBox</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlBox that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2092CircleCollide><td class='subtablehead' colspan='2' id=CircleCollide>Method CircleCollide:tlCollisionResult(circle:tlCircle)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlCircle</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlCircle that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2429Draw><td class='subtablehead' colspan='2' id=Draw>Method Draw(offsetx:Float = 0, offsety:Float = 0, boundingbox:Int = False)</td></tr><tr><td style='width:90px'>Description:</td><td>Draw the polygon</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		You can use this for debugging purposes. Pass true of false to draw the bounding box as well.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2186LineCollide><td class='subtablehead' colspan='2' id=LineCollide>Method LineCollide:tlCollisionResult(Line:tlLine)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with a #tlLine</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlLine that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1936Move><td class='subtablehead' colspan='2' id=Move>Method Move(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Move the bounding box by a given amount.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets the position of the top left corner of the bounding box by moving it by the x and y amount. If the box is within quadtree it <br />		will automatically update itself within it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1825New><td class='subtablehead' colspan='2' id=New>Method New(x:Float, y:Float, verts:Float[], layer:Int = tlLAYER_0, data:Object = Null, centerhandle:Int = True)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlPolygon</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns New #tlPolygon, or Null if verts[] contained the wrong amount.<br />		Create a new #tlPolygon at the given coordinates with the given array of vertices. The coordinates will represent the center of the polygon, but this<br />		can be changed with #SetPolyHandle. The array must contain more then 5 values (2 per vertex) and be an even number or null will be returned. The coordinates of<br />		the vertices in the array are arranged like so: [x,y,x,y,x,y  etc]. You can also assign some data to the boundary as handy way to store some extra info about the boundary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1864New><td class='subtablehead' colspan='2' id=New>Method New(verts:Float[], layer:Int = tlLAYER_0, data:Object = Null)</td></tr><tr><td style='width:90px'>Description:</td><td>Create a #tlPolygon</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns New #tlPolygon, or Null if verts[] contained the wrong amount.<br />		Create a new #tlPolygon at the given coordinates with the given array of vertices. The coordinates will represent the center of the polygon, but this<br />		can be changed with #SetPolyHandle. The array must contain more then 5 values (2 per vertex) and be an even number or null will be returned. The coordinates of<br />		the vertices in the array are arranged like so: [x,y,x,y,x,y  etc]. You can also assign some data to the boundary as handy way to store some extra info about the boundary.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1965PointInside><td class='subtablehead' colspan='2' id=PointInside>Method PointInside:Int(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Find out if a point resides withing the #tlPolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns True if they do overlap<br />		Use this to check if a point with the given coordinates lies within the polygon<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2276PolyCollide><td class='subtablehead' colspan='2' id=PolyCollide>Method PolyCollide:tlCollisionResult(poly:tlPolygon)</td></tr><tr><td style='width:90px'>Description:</td><td>Check for a collision with another #tlpolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult type containing info about the collision<br />		Use this to check for a collision with a #tlPolygon that you pass to the method. You can then use the information stored in <br />		#tlCollisionResult to perform various things based on the result of the collision check.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=2367RayCollide><td class='subtablehead' colspan='2' id=RayCollide>Method RayCollide:tlCollisionResult(px:Float, py:Float, dx:Float, dy:Float, maxdistance:Float = 0)</td></tr><tr><td style='width:90px'>Description:</td><td>See is a ray collides with this #tlpolygon</td></tr><tr><td style='width:90px'>Returns:</td><td>tlCollisionResult</td></tr><tr><td style='width:90px'>Details:</td><td>		Returns #tlCollisionResult with the results of the collision<br />		You can use this to test for a collision with a ray. Pass the origin of the ray with px and py, and set the direction of the ray with dx and dy.<br />		dx and dy will be normalised and extended infinitely, if maxdistance equals 0 (default), otherwise set maxdistance to how ever far you want the ray <br />		to extend to. If the ray starts inside the poly then result.rayorigininside will be set to true.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1897Rotate><td class='subtablehead' colspan='2' id=Rotate>Method Rotate(angle:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Rotate the polygon</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This will rotate the polygon by the given amount<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1907SetAngle><td class='subtablehead' colspan='2' id=SetAngle>Method SetAngle(angle:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the angle of the polygon</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This will adjust the angle of the polygon by the given amount.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1919SetPosition><td class='subtablehead' colspan='2' id=SetPosition>Method SetPosition(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the position of the bounding box.</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets the position of the top left corner of the bounding box. If the box is within quadtree it will automatically update itself<br />		within it.<br /></td></tr></table></tr></td><tr><td colspan='2'><table style='width: 100%' class = 'subtable'><tr id=1952SetScale><td class='subtablehead' colspan='2' id=SetScale>Method SetScale(x:Float, y:Float)</td></tr><tr><td style='width:90px'>Description:</td><td>Set the scale of the Polygon</td></tr><tr><td style='width:90px'>Returns:</td><td>Int</td></tr><tr><td style='width:90px'>Details:</td><td>		This sets scale of the polygon.<br /></td></tr></table></tr></td></table><br />
<p class="junglefooter">This document was generated using the <a href="http://www.jungleide.com/">Jungle IDE</a> document generator version 13.03.24-B</p>
</body>
</html>
